package org.pfc.porlapatilla.repositories;

import org.pfc.porlapatilla.model.User;
import org.springframework.data.mongodb.repository.MongoRepository;

/**
 * This Repository provides data access to UserService.
 * 
 * @author jorgepolobermudez
 * 
 */
public interface UserRepository extends MongoRepository<User, String> {

    /**
     * Find an user by id.
     * 
     * @param id
     *            The user id.
     * @return The found user.
     */
    User findById(String id);

    /**
     * Find an user by email.
     * 
     * @param email
     *            The user email.
     * @return The found user.
     */
    User findByEmail(String email);

    /**
     * Find an user by nick.
     * 
     * @param nick
     *            The user nick
     * @return The found user.
     */
    User findByNick(String nick);

}
